<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" aria-labelledby="createOrEditModal" class="modal fade"
  tabindex="-1" role="dialog" aria-hidden="true" [config]="{backdrop: 'static'}">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
      <form *ngIf="active" #PersonalitysForm="ngForm" name="CommonForm" novalidate (ngSubmit)="save()"
        autocomplete="off">
        <div class="modal-header">
          <h4 class="modal-title">
            <span *ngIf="WhiteList?.id">{{l("editWhiteList")}}: {{WhiteList?.id +' | '+WhiteList?.name}}</span>
            <span *ngIf="!WhiteList?.id">{{l("CreateNewWhitelist")}}</span>
          </h4>
          <button type="button" class="close" (click)="close()" aria-label="Close">
            <i aria-hidden="true" class="ki ki-close"></i>
          </button>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-12">
              <div class="row">
                <div class="form-group col-6">
                  <label>{{l("name")}} *</label>
                  <input class="form-control" type="text" name="name" required [(ngModel)]="WhiteList.name">
                </div>
                <div class="form-group col-6">
                  <label>{{l("type")}}</label>
                  <div class="form-group ">
                    <div class="input-group">
                      <select class="form-control" [(ngModel)]="WhiteList.type" name="type">
                        <option value="0">{{l('WhitelistList')}}</option>
                        <option value="1">{{l('BlackList')}}</option>
                      </select>
                    </div>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="form-group col-2">
                  <label class="checkbox checkbox-primary" style="position:relative;top:0;">
                    <input [(ngModel)]="WhiteList.forAward" type="checkbox"
                      [ngModelOptions]="{standalone: true}" />{{l("forAward")}}
                    <span></span>
                  </label>
                </div>
                <div class="form-group col-2">
                  <label class="checkbox checkbox-primary" style="position:relative;top:0;">
                    <input [(ngModel)]="WhiteList.forLottery" type="checkbox"
                      [ngModelOptions]="{standalone: true}" />{{l("forLottery")}}
                    <span></span>
                  </label>
                </div>
                <div class="form-group col-2">
                  <label class="checkbox checkbox-primary" style="position:relative;top:0;">
                    <input [(ngModel)]="WhiteList.forUseTicket" type="checkbox"
                      [ngModelOptions]="{standalone: true}" />{{l("forUseTicket")}}
                    <span></span>
                  </label>
                </div>
              </div>
              <div class="row" *ngIf="WhiteList.forAward&&AwardList.length>0">
                <div style="margin-left:15px;">
                  <label>{{l("awardSeq")}}</label>
                </div>
                <div class="form-group col-1" *ngFor="let item of AwardList">
                  <label class="checkbox checkbox-primary" style="position:relative;top:0;">
                    <input [(ngModel)]="item.chosen" type="checkbox"
                      [ngModelOptions]="{standalone: true}" />{{item.seq}}
                    <span></span>
                  </label>
                </div>
              </div>
              <div class="row">
                <div class="form-group col-6">
                  <label>{{l("phone")}}</label>
                  <input class="form-control" type="text" name="phone" [(ngModel)]="WhiteList.phone">
                </div>
                <div class="form-group col-6">
                  <label>{{l("address")}}</label>
                  <input class="form-control" type="text" name="address" [(ngModel)]="WhiteList.address">
                </div>
              </div>
              <div class="row">
                <div class="form-group col-6">
                  <label>{{l("identityID")}}</label>
                  <input class="form-control" type="text" name="identityID" [(ngModel)]="WhiteList.identityID">
                </div>
                <div class="form-group col-6">
                  <label>{{l("CompanyName")}}</label>
                  <input class="form-control" type="text" name="companyName" [(ngModel)]="WhiteList.companyName">
                </div>
              </div>
              <div class="row">
                <div class="form-group col-12">
                  <label>{{l("description")}}</label>
                  <input class="form-control" type="text" name="description" [(ngModel)]="WhiteList.description">
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button [disabled]="saving" type="button" class="btn btn-primary" (click)="close()">{{l("Cancel")}}</button>
          <button type="submit" class="btn btn-primary blue" [disabled]="!PersonalitysForm.form.valid"
            [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
            <i class="fa fa-save"></i>
            <span>{{l("Save")}}</span>
          </button>
        </div>
      </form>
    </div>
  </div>
</div>